<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            margin: 100px auto;
        }

        span {
            display: inline-block;
            width: 50px;
            height: 50px;
            background-color: #999;
            text-align: center;
            line-height: 50px;
            font-size: 25px;
            font-weight: 700;
        }
    </style>
</head>

<body>
    <div>
        <span class="h">1</span>
        <span class="m">2</span>
        <span class="s">3</span>
    </div>
    <script>
        var h = document.querySelector('.h');
        var m = document.querySelector('.m');
        var s = document.querySelector('.s');
        function getTime() {
            var date = new Date();
            var hour = date.getHours();
            h.innerHTML = hour;
            var minute = date.getMinutes();
            m.innerHTML = minute;
            var second = date.getSeconds();
            second = second < 10 ? '0' + second : second;
            s.innerHTML = second;
        }
        getTime();
        var timer = setInterval(getTime, 1000);
    </script>
    <script>

    </script>
</body>

</html>